<%@ page import="java.util.List" %>
<%@ page import="userDao.Group" %><%--
  Created by IntelliJ IDEA.
  User: Ly
  Date: 2021/4/10
  Time: 17:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>班级管理界面</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
</head>
<body>
<%
    List<Group> groupList = (List<Group>) session.getAttribute("groupList");
    Group name = (Group) session.getAttribute("group");
%>
<h1 style="text-align: center">欢迎进入班级管理界面！</h1>
<div>
    <a href="${pageContext.request.contextPath}/setUpGroup.jsp"><button class="btn btn-success" id="addGroup">创建班级</button></a>
    <a href="${pageContext.request.contextPath}/deleteGroup.jsp"><button class="btn btn-success" id="deleteGroup">删除班级</button></a>
    <a href="${pageContext.request.contextPath}/lookUpGroup.jsp"><button class="btn btn-success" id="lookUpGroup">查询班级</button></a>
    <a href="${pageContext.request.contextPath}/editGroup.jsp"><button class="btn btn-success" id="editGroup">修改班级</button></a>
    <a href="${pageContext.request.contextPath}/studentManage.jsp"><button class="btn btn-success" >回到学生管理界面</button></a>
</div>
<div>
    <%= request.getAttribute("group") == null?"": request.getAttribute("group") %>
</div>
<div>
<table class="table">
    <thead>
    <tr>
        <th>name</th>
        <th>groupNum</th>
        <th>teacherName</th>
        <th>slogan</th>
        <th>studentNum</th>
    </tr>
    </thead>
    <tbody>
    <% for(int i = 0;i < groupList.size();i++){ %>
        <tr>
            <td><%= groupList.get(i).getName()%></td>
            <td><%= groupList.get(i).getGroupNum()%></td>
            <td><%= groupList.get(i).getTeacherName()%></td>
            <td><%= groupList.get(i).getSlogan()%></td>
            <td><%= groupList.get(i).getStudentNum()%></td>
        </tr>
    <%}%>
    </tbody>
</div>

</body>
<script src="bootstrap/js/jquery-3.3.1.min.js"></script>
<script src="bootstrap/js/bootstrap.min.js"></script>
</html>
